const webpack = require("webpack");
module.exports = {
  //路径前缀
  publicPath: "./",
  lintOnSave: true,
  productionSourceMap: false,
  // configureWebpack: {
  //   plugins: [
  //     new webpack.ProvidePlugin({
  //       "window.Quill": "quill/dist/quill.js",
  //       Quill: "quill/dist/quill.js"
  //     })
  //   ]
  // },

  chainWebpack: config => {
    //忽略的打包文件
    config.externals({
      vue: "Vue",
      "vue-router": "VueRouter",
      vuex: "Vuex",
      axios: "axios",
      "element-ui": "ELEMENT"
    });
    config.plugin("provide").use(webpack.ProvidePlugin, [
      {
        "window.Quill": "quill/dist/quill.js",
        Quill: "quill/dist/quill.js"
      }
    ]);
    const entry = config.entry("app");
    entry.add("babel-polyfill").end();
    entry.add("classlist-polyfill").end();
    entry.add("@/mock").end();
  },
  devServer: {
    port: 1888,
    proxy: {
      "/api": {
        //本地服务接口地址

        //target: "http://localhost",
       // target: "http://172.16.103.237", //小石
        target: "http://172.16.100.9", //正式
        //target:"http://172.16.100.61",
        //target: "http://172.16.103.156", //小明
        //target: "http://172.16.100.61", //小吴
        //远程演示服务地址,可用于直接启动项目
        //target: 'https://saber.bladex.vip/api',
        //正式环境：http://172.16.100.9:8123/#/login
        ws: true,
        pathRewrite: {
          "^/api": "/"
        }
      },
      "/report": {
        target: "http://172.16.103.237:8190",
        ws: true,
        pathRewrite: {
          "^/report": "/"
        }
      }
    }
  }
};
